
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

if __name__ == '__main__':
    driver = webdriver.Chrome()
    driver.get(url='https://mail.qq.com/')
    driver.switch_to.frame(1)
    driver.switch_to.frame('ptlogin_iframe')
    driver.find_element(By.XPATH, './/*[@id="switcher_plogin"]').click()
    driver.find_element(By.XPATH, './/input[@id="u"]').send_keys('124540504')
    driver.find_element(By.XPATH, './/input[@id="p"]').send_keys('124540504')

    '''这个进上一层'''
    driver.switch_to.parent_frame()

    '''这个进初始层'''
    driver.switch_to.default_content()

    time.sleep(10)
    driver.quit()







